<script setup lang="ts">
import { provide, ref } from "vue";
import HmTest from "./components/HmTest.vue";
import HmButton from "./components/HmButton.vue";
import HmNavBar from "./components/HmNavBar.vue";
const info = ref(9);
const age = ref(18);
const name = (name: string) => {
  console.log("子组件触发回调函数", name);
};
const getAge = (age: number) => {
  console.log("子组件触发回调函数", age);
};

provide("info", info);
provide("updateTotalCount", (num: number) => (info.value += num));
</script>

<template>
  <HmNavBar><button>插槽测试</button></HmNavBar>
  <HmButton :text="'测试1'"></HmButton>
  <HmButton text="测试2"></HmButton>
  <HmButton />
  <div>Hello World!</div>
  <HmTest :name="'Tom'" :age="6" @my-evevt="name" @my-evevt2="getAge"></HmTest>
</template>
<style lang="less" scoped></style>
